wayland: Make data_source_target() an empty stub
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 9 Mar 2016 16:30:29 +0000 (17:30 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 9 Mar 2016 17:39:16 +0000 (18:39 +0100)
This request actually means nothing to the upper GDK layers,
we used to preempt a GDK_SELECTION_REQUEST event, but this is too
eager, and not like things work in X11.

Originally in wayland, this event may be used for feedback purposes.
We however don't perform any mimetype-based feedback, so we can
safely ignored.

This makes data_source_send() the only place where we actually
trigger GDK_SELECTION_REQUEST, this one is conceptually the same
than the X11 selection request event.

gdk/wayland/gdkselection-wayland.c

index e1dd69b96a91268406cbb34c2440865ce7b9d75f..d6555d54cdd639b5d80abd7d971464c3f1def439 100644 (file)
@@ -823,34 +823,8 @@ data_source_target (void                  *data,
                     struct wl_data_source *source,
                     const char            *mime_type)
 {
-  GdkWaylandSelection *wayland_selection = data;
-  GdkWindow *window = NULL;
-  GdkAtom selection;
-
   g_debug (G_STRLOC ": %s source = %p, mime_type = %s",
            G_STRFUNC, source, mime_type);
-
-  if (!mime_type)
-    return;
-
-  if (source == wayland_selection->dnd_source)
-    {
-      selection = atoms[ATOM_DND];
-      window = wayland_selection->dnd_owner;
-    }
-  else if (source == wayland_selection->clipboard_source)
-    {
-      selection = atoms[ATOM_CLIPBOARD];
-      window = wayland_selection->clipboard_owner;
-    }
-
-  if (!window)
-    return;
-
-  gdk_wayland_selection_request_target (wayland_selection, window,
-                                        selection,
-                                        gdk_atom_intern (mime_type, FALSE),
-                                        -1);
 }
 
 static void